import { GetOrderDetailParams } from './paramsInterface';
import request from '../request';
import {
  GET_ORDER_LIST_REQ,
  GET_COURSE_ORDER_DETAIL_REQ,
  GET_DEPOSIT_ORDER_DETAIL_REQ
} from '../../service/constant';
import { OrderList } from './getOrderList';
import { CourseOrderDetail } from './getCourseOrderDetail';
import { DepositOrderDetail } from './getDepositOrderDetail';

export default {
  // 获取订单列表
  getOrderList: (): Promise<OrderList> =>
    request({
      msgId: GET_ORDER_LIST_REQ,
      param: { needLoading: true }
    }),
  // 获取单个课程订单详情
  getCourseOrderDetail: (
    data: GetOrderDetailParams
  ): Promise<CourseOrderDetail> =>
    request({
      msgId: GET_COURSE_ORDER_DETAIL_REQ,
      data,
      param: { needLoading: true }
    }),
  // 获取单个订金订单详情
  getDepositOrderDetail: (
    data: GetOrderDetailParams
  ): Promise<DepositOrderDetail> =>
    request({
      msgId: GET_DEPOSIT_ORDER_DETAIL_REQ,
      data,
      param: { needLoading: true }
    })
};
